from PyQt4 import QtGui
from design.Ui_qMainWindow import Ui_MainWindow
from design.Ui_qPreferenceDlg import Ui_PreferenceDlg

from qDOMTreeView import qDOMTreeView

class qMainWindow(QtGui.QMainWindow):
	def __init__(self, parent = None):
		QtGui.QMainWindow.__init__(self, parent)
		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)
		
		self.ui.dockWidget_Left.setWidget(qDOMTreeView())
		
		#self.ui.actionPreferences.connect(self.ui.actionPreferences, QtCore.SIGNAL('triggered()'), self.ShowPreference)
		self.ui.actionPreferences.triggered.connect(self.ShowPreference)
	
	def closeEvent(self, event):
		QtGui.qApp.quit()
		event.ignore()
	
	def ShowPreference(self):
		dlg = QtGui.QDialog(self)
		ui = Ui_PreferenceDlg()
		ui.setupUi(dlg)
		dlg.show()
		
	
		
		
		
		
